/*
@hehung
2023-2-8
转载请注明出处，版权由@hehung所有
email: 1398660197@qq.com
wechat: hehung95
*/

#ifndef APP_COMMON_H_
#define APP_COMMON_H_

#include "hal_data.h"
#include "FreeRTOS.h"
#include "task.h"

#define FREERTOS_OS                 (1U)

#ifndef FREERTOS_OS
#define DELAY_MS(ms)                R_BSP_SoftwareDelay(ms, BSP_DELAY_UNITS_MILLISECONDS);
#else
#define DELAY_MS(ms)                vTaskDelay(pdMS_TO_TICKS(ms));
#define ENTER_CRITICAL()            taskENTER_CRITICAL()
#define EXIT_CRITICAL()             taskEXIT_CRITICAL()
#endif

#define COMM_ON                     (0)
#define COMM_OFF                    (1)

// uart printf for debug
#define COMM_DEBUG                  

#ifdef COMM_DEBUG
#include <stdio.h>
// uart printf
#define COMM_PRINT(...)             printf(##__VA_ARGS__);
// log for uart printf
#define COMM_LOG(...)
#endif /* COMM_DEBUG */

// event group flags
#define EVENT_GROUP_SET_BIT(bit)    ((1U << (bit)) & 0x00FFFFFFU)
#define EVENT_GROUP_0_INIT          (0)





#endif /* APP_COMMON_H_ */
